package com.ymatou.iapi.godmch.testcase;

import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.godmch.parameter.CreateCodeBean;
import com.ymatou.iapi.godmch.parameter.editmchBean;
import com.ymatou.iapi.godmch.parameter.getAutomaticWithdrawalConfigBean;
import com.ymatou.iapi.godmch.service.getAutomaticWithdrawalConfigCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
import com.ymttest.database.model.godmch.biz_config;
import com.ymttest.database.model.godmch.biz_configExample;
import com.ymttest.database.sqlwapper.godmch.biz_configWapper;
import com.ymttest.utils.TestDataManager;
/**
*获取所有开启自动提现的商户id
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_getAutomaticWithdrawalConfig{
	private static getAutomaticWithdrawalConfigBean bean;
	private static getAutomaticWithdrawalConfigCall call;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取所有开启自动提现的商户id");
	}

	@Before
	public void caseUp() {
		bean=new getAutomaticWithdrawalConfigBean();
		call=new getAutomaticWithdrawalConfigCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_getAutomaticWithdrawalConfig_001() {
		Logger.start(true,"获取所有开启自动提现的商户id-平台商户代理");
		try {
			call.setData(bean);
			call.callService();			
			
			biz_configWapper biz_configWapper=new biz_configWapper();
			biz_configExample example =new biz_configExample();
			example.createCriteria().andBiz_keyEqualTo("auto_withdrawal").andBiz_valueEqualTo("1");
			List<biz_config> bizs=biz_configWapper.selectByExample(example);
			Logger.verifyEquals("200", call.getStatusCode1(), "验证返回成功status值");
	        Logger.verifyEquals("请求成功", call.getMessage(), "验证返回成功Message值");
	        Logger.verifyEquals(bizs.size(), call.getMerchantIdList().length(), "验证返回成功MerchantIdList");
	        
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
}